local targetList = {
  {itemID = 210805, price = 0, name = "圣祝棠", },
}

local frame = CreateFrame("Frame")

local function GetListItem(itemID, list)
  local item = nil
  for k, v in pairs(list) do
    if v.itemID == itemID then
      item = v
    end
  end
  return item
end
C_QuestLog.IsQuestFlaggedCompleted(29510)
function frame:COMMODITY_SEARCH_RESULTS_UPDATED(event, itemID)
  if searchCompleted then return end
  -- print('COMMODITY_SEARCH_RESULTS_UPDATED', itemID, C_AuctionHouse.GetNumCommoditySearchResults(itemID))
  local curItem = GetListItem(itemID, targetList)
  if curItem == nil then return end
  local res = C_AuctionHouse.GetCommoditySearchResultInfo(itemID, 1)
  print("res.unitPrice", res.unitPrice)
  if (res and (res.unitPrice <= curItem.tartgetPrice) and res.quantity > 10) then
    table.insert(filterTargets, {itemID = itemID, name = curItem.name, tartgetPrice = curItem.tartgetPrice, unitPrice = res.unitPrice, quantity = quantity})
    print(string.format("name:%s, 价格:%d, 目标价:%d, 数量:%d", curItem.name, res.unitPrice, curItem.tartgetPrice, quantity))
  else
    filterTargets = {}
  end
  searchCompleted = true
end